package com.lin.linchatgpt.utils;

import java.util.UUID;

/**
 * Copyright(C),2022年-2022,霖霖
 *
 * @author 霖霖
 * @version 1.0
 * @date 2023/6/10 14:30
 * @Description
 */
public class EmailTemplate {

    public static String getEmailContent(String content) {
        // 使用字符串拼接的方式构建邮件内容，避免使用模板引擎
        return "<!DOCTYPE html>\n" +
                "<html lang=\"en\">\n" +
                "<head>\n" +
                "    <meta charset=\"UTF-8\">\n" +
                "    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n" +
                "    <title>LIN-ChatGPT邮箱验证</title>\n" +
                "    <style>\n" +
                "        body {\n" +
                "            font-family: Arial, sans-serif;\n" +
                "            background-color: #f0f0f0;\n" +
                "            padding: 50px;\n" +
                "        }\n" +
                "\n" +
                "        h1 {\n" +
                "            color: #333;\n" +
                "            font-size: 24px;\n" +
                "            text-align: center;\n" +
                "            margin-bottom: 20px;\n" +
                "        }\n" +
                "\n" +
                "        p {\n" +
                "            color: #666;\n" +
                "            font-size: 16px;\n" +
                "            text-align: center;\n" +
                "            margin-bottom: 30px;\n" +
                "        }\n" +
                "\n" +
                "        a {\n" +
                "            display: block;\n" +
                "            background-color: #3498db;\n" +
                "            color: #fff;\n" +
                "            font-size: 16px;\n" +
                "            padding: 10px 20px;\n" +
                "            text-decoration: none;\n" +
                "            border-radius: 5px;\n" +
                "            margin: 0 auto;\n" +
                "            text-align: center;\n" +
                "            width: fit-content;\n" +
                "        }\n" +
                "\n" +
                "        a:hover {\n" +
                "            background-color: #2980b9;\n" +
                "        }\n" +
                "    </style>\n" +
                "</head>\n" +
                "<body>\n" +
                "    <h1>LIN-ChatGPT邮箱验证</h1>\n" +
                "    <p>请点击下面的按钮验证您的邮箱</p>\n" +
                "    <a href=\" " + content + " \">开始验证</a>\n" +
                "</body>\n" +
                "</html>";


    }



    // 内容构建
    public static String getValidLink(String email, String uuid, String ip) {

        return "https://" +ip+"/lin_chat/valid_code/verifyEmail?email="+email+"&token=" + uuid;
    }

}
